package com.zdxlz.fcmp.common.mybatis.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description：IPSec模板配置表【IKE加密算法】枚举类
 * @Author： aman
 * @Date： 2025/2/8 10:56
 */
@Getter
@AllArgsConstructor
public enum IkedhGroupEnum {
    IKE_NONE(0, "none"),
    IKE_GROUP1(1, "group1"),
    IKE_GROUP2(2, "group2"),
    IKE_GROUP5(5, "group5"),
    IKE_GROUP14(14, "group14"),
    ;
    @EnumValue
    private final Integer code;
    private final String name;

    public static IkedhGroupEnum getByCode(Integer code) {
        for (IkedhGroupEnum ikedhGroupEnum : IkedhGroupEnum.values()) {
            if (ikedhGroupEnum.getCode() == code) {
                return ikedhGroupEnum;
            }
        }
        return null;
    }

    @JsonValue
    public int getCode() {
        return code;
    }
}
